export default {
	data() {
		return {
			resizeTimeOut: null,
		}
	},
	mounted() {
		// 监听窗口变化
		window.addEventListener("resize", this.resizeFunc)
	},
	beforeDestroy() {
		window.removeEventListener("resize", this.resizeFunc)
	},
	methods: {
		/**
		 * @method resizeTimeOut
		 */
		resizeFunc() {
			clearTimeout(this.resizeTimeOut)
			this.resizeTimeOut = setTimeout(() => {
				this.myChart.resize()
				clearTimeout(this.resizeTimeOut)
				this.resizeTimeOut = null
			}, 250)
		},
	},
}
